#pragma once
#include "KeyConverter.h"

/**
================================
A processed KeyEvent is passed to a 
Listener for comsuption
================================
*/
class KeyEvent
{
public:
    KeyEvent(void) : m_Key(MK_UNKNOWN), m_modifier( 0 ) {};
    KeyEvent( int key, int mod ) : m_Key(key), m_modifier( mod ) {};

    /** Get the key pressed */
    int GetKey() const;

    /** Get the string associated with this key code */
    std::string GetKeyText( int key ) const;

    /** Get the keycode from a string */
    int GetKeyCode( const std::string &str ) const;

    /** Get the shift value of the key code */
    char    GetShiftKey( int key ) const;

    /** Get Modifier (e.i. Shift Key/ctrl Key ) */
    int     GetModifier() const;

    /**
        Modifier flags
    */
    enum Modifier_t 
    {
        SHIFT           =   (1<<0),
        CTRL            =   (1<<1),

        BUTTON_DOWN     =   (1<<2),
        BUTTON_RELEASED =   (1<<3)
    };

private:
    KeyEvent( const KeyEvent &e );
    KeyEvent& operator=(const KeyEvent& e);
    KeyConverter            m_keyConverter;     // convert from keycode to str
    int                     m_Key;              // key associated with the event
    int                     m_modifier;         // modifier Flag


public:
    virtual ~KeyEvent(void);
};
